package com.example.rabbitmqstudy.service;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.example.rabbitmqstudy.constant.RabbitConstant;

/**
 * @author admin
 * @date 2021/07/15 15:09
 */
@Component
public class RabbitHeaderConsumer {

    @RabbitListener(queues = RabbitConstant.HEADER_FIRST_QUEUE_NAME)
    @RabbitHandler
    public void headerFirstQueue(String context){
        System.out.println("rabbit header queue first receiver: " + context);
    }
    @RabbitHandler
    @RabbitListener(queues = RabbitConstant.HEADER_SECOND_QUEUE_NAME)
    public void headerSecondQueue(String context){
        System.out.println("rabbit header queue second receiver: " + context);
    }

}
